#!/usr/bin/env/python
import os

class Playlist:
		def __init__(self, dir_path, playlist_path):
			self.dp = dir_path
			self.pp = playlist_path

		def writePlaylist(self):
				'crea una playlist leggendo una directory'
				file = open(self.pp, 'w')
				for f in os.listdir(self.dp):
						(shortname, extension) = os.path.splitext(f)
						if(extension=='.avi'): 
								file.write(self.pp[:-11] +f+"\n")


dd = Playlist("//home//da//python//video","/home/da/python/video/elencovideo")
dd.writePlaylist()
